//
//  HNDistributionAddStudentCell.m
//  优学荟管理系统
//
//  Created by edz on 2017/12/13.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "HNDistributionAddStudentCell.h"

@implementation HNDistributionAddStudentCell
{
    __weak IBOutlet UIImageView *_Img;
    __weak IBOutlet UILabel *_Name;
    __weak IBOutlet UIButton *_Select;
}

- (void)setModel:(HNDistributionStudentModel *)Model {
    
    _Model = Model;
    
    _Name.text = Model.petName;
    [Model.avatar isKindOfClass:[NSNull class]] ? nil : [_Img sd_setImageWithURL:[NSURL URLWithString:Model.avatar] placeholderImage:[UIImage imageNamed:@"bg_picture_default_DistributionStudent"]];
    _Select.selected = Model.Selected;
}


- (IBAction)ClickSelect:(UIButton *)sender {
    
    self.ClickSelect ? self.ClickSelect(self.Model) : nil;
}


- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    _Img.layer.masksToBounds = YES;
    _Img.layer.cornerRadius = _Img.frame.size.width / 2;
}
@end
